/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package f4;
import com.jcraft.jsch.*;
/**
 *
 * @author thleontev
 */
public class F4 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        
    UserInfo ui = new MyUserInfo();
    try{
        JSch jsch=new JSch();
        Session session=jsch.getSession("test", "tst", 22);
        session.setUserInfo(ui);
        session.connect(30000);
        
        Channel channel=session.openChannel("shell");
        channel.setInputStream(System.in);
        channel.setOutputStream(System.out);
        channel.connect(3*1000);
    }
       catch(Exception e){
      System.out.println(e);
        }
    }